package com.example.zyh.mapper;

import com.example.zyh.pojo.Zuhu;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ZuhuMapper {
    @Select("select * from zuhu")
    public List<Zuhu> selectZuhu();
    @Insert("INSERT INTO zuhu ( `name`, `age`, `sex`, `address`, `idcard`)\n" +
            "\tVALUES( #{name}, #{age},#{sex},#{address}, #{idcard})")
    public void addZuhu(Zuhu zuhu);
    @Delete("DELETE FROM zuhu WHERE `id` =#{id}")
    public void deleteZuhu(int id);
    @Update("UPDATE zuhu SET `name` = #{name}, `age` = #{age}, `sex` = #{sex}, `address` =#{address}, `idcard` = #{idcard} WHERE `id` = #{id}")
    public void updateZuhu(Zuhu zuhu);
    @Select("SELECT * FROM zuhu where name=#{name} or age=#{age}")
    public List<Zuhu> selectlike(Zuhu zuhu);
}
